﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DYPSensor
{
    /// <summary>
    /// 传感器读取类型
    /// </summary>
    public enum SensorReadType : int
    {
        /// <summary>
        /// 测量距离实时值
        /// </summary>
        Distance = 0,

        /// <summary>
        /// 测量距离过滤值
        /// </summary>
        DistanceFilterValue = 1,

        /// <summary>
        /// 温度
        /// </summary>
        Temperature = 2,

        /// <summary>
        /// 同时读取以上三种
        /// </summary>
        All = 3,
    }

    public class SensorReadResult
    {
        /// <summary>
        /// 测量结果类型
        /// </summary>
        public SensorReadType ReadType { get; set; }

        /// <summary>
        /// 测量结果
        /// </summary>
        public float ReadValue { get; set; }

        public SensorReadResult()
        {
            ReadType = SensorReadType.Distance;
            ReadValue = 0.0F;
        }

        public SensorReadResult(SensorReadType readType, float readValue)
        {
            ReadType = readType;
            ReadValue = readValue;
        }
    }
}
